package com.foreknow.service.impl;

import com.foreknow.dao.DisecategoryMapper;
import com.foreknow.entity.Disecategory;
import com.foreknow.service.DisecategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DisecategoryServiceImpl implements DisecategoryService {
    @Autowired
    private DisecategoryMapper disecategoryMapper;

    @Override
    public int deleteById(Integer id) {
        return disecategoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Disecategory> selectAllDisecategory() {
        return disecategoryMapper.selectAll();
    }

    @Override
    public int addCategory(Disecategory record) {
        return disecategoryMapper.insertSelective(record);
    }

    @Override
    public Disecategory selectOne(Integer id) {
        return disecategoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public int update(Disecategory record) {
        return disecategoryMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public Disecategory queryDouble() {
        return disecategoryMapper.selectDouble();
    }
}